<?php
		mysql_data_seek($forms_info, 0);
		/*echo "<pre>";
			print_r($forms_info);
		echo "</pre>";*/
		
		//$external_only = $forms_info;
		/*while($crap = sqlFetchArray($external_only)){
			echo "<pre>";
			print_r($crap);
		echo "</pre>";
		}*/
		
		$slit1 = '';
		$slit2 = '';
		$slit3 = '';
		$slit4 = '';
		$slit5 = '';
		$slit6 = '';
		$slit7 = '';
		$slit8 = '';
		$slit9 = '';
		
		function create_slit($value){
			global $forms_info, $slit1, $slit2, $slit3, $slit4, $slit5, $slit6, $slit7, $slit8, $slit9;
			$slit1 = "<td><select type='text' id='1_slitlamp_1' name='1_slitlamp_1'>".
					"	<option value='1' text='".xl ('0 None')."'>".
							xl ('0 None').
					"	</option>".
					"	<option value='2' text='".xl ('1+ Mid')."'>".
							xl ('1+ Mid') .
					"	</option>".
					"	<option value='3' text='".xl ('2+ Moderate')."'>".
							xl ('2+ Moderate') .
					"	</option>".
					"	<option value='4' text='".xl ('3 + Severe')."'>".
							xl('3+ Severe') .
					"	</option>".
					"</select></td>";
			$slit2 = "<td><select type='text' id='1_slitlamp_2' name='1_slitlamp_2'>".
					"	<option value='1' text='".xl ('0 None')."'>".
							xl ('0 None').
					"	</option>".
					"	<option value='2' text='".xl ('1+ Mid')."'>".
							xl ('1+ Mid') .
					"	</option>".
					"	<option value='3' text='".xl ('2+ Moderate')."'>".
							xl ('2+ Moderate') .
					"	</option>".
					"	<option value='4' text='".xl ('3 + Severe')."'>".
							xl('3+ Severe') .
					"	</option>".
					"</select></td>";
			
			$slit3 = "	<td><select type='text' id='1_slitlamp_3' name='1_slitlamp_3'>".
					"	<option value='1' text='".xl('0<1 cell')."'>".
							xl('0<1 cell') .						
					"	</option>".
					"	<option value='2' text='".xl('0.5+ 1-5 cells')."'>".
							xl('0.5+ 1-5 cells') .						
					"	</option>".
					"	<option value='3' text='".xl('1+ 6-15 cells')."'>".
							xl('1+ 6-15 cells') .						
					"	</option>".
					"	<option value='4' text='".xl('2+ 16-25 cells')."'>".
							xl('2+ 16-25 cells') .						
					"	</option>".
					"	<option value='5' text='".xl('3+ 26-50 cells')."'>".
							xl('3+ 26-50 cells') .						
					"	</option>".
					"	<option value='6' text='".xl('4+ >50 cells')."'>".
							xl('4+ >50 cells') .						
					"	</option>				".		
					"</select></td>";
			$slit4 ="<td><select type='text' id='1_slitlamp_4' name='1_slitlamp_4'>".
					"		<option value='1' text='".xl('0 None')."'>".
								xl('0 None') .							
					"		</option>".
					"		<option value='2' text='".xl('1+ Debil')."'>".
								xl('1+ Debil') .							
					"		</option>".
					"		<option value='3' text='".xl('2+ Moderate (Iris and lens details clear)')."'>".
								xl('2+ Moderate (Iris and lens details clear)') .							
					"		</option>".
					"		<option value='4' text='".xl('3+ Marked (Iris and lens details hazy)')."'>".
								xl('3+ Marked (Iris and lens details hazy)') .							
					"		</option>".
					"		<option value='5' text='".xl('4+ Itense (Fibrin or plastic aqueous)')."'>".
								xl('4+ Itense (Fibrin or plastic aqueous)') .							
					"		</option>".
					"</select></td>";
			$slit5 = "<td><select type='text' id='1_slitlamp_5' name='1_slitlamp_5'>".
					"	<option value='1' text='".xl ('0 None')."'>".
							xl ('0 None').
					"	</option>".
					"	<option value='2' text='".xl ('1+ Mid')."'>".
							xl ('1+ Mid') .
					"	</option>".
					"	<option value='3' text='".xl ('2+ Moderate')."'>".
							xl ('2+ Moderate') .
					"	</option>".
					"	<option value='4' text='".xl ('3 + Severe')."'>".
							xl('3+ Severe') .
					"	</option>".
					"</select></td>";
			$slit6 = "<td><select type='text' id='1_slitlamp_6' name='1_slitlamp_6'>".
					"	<option value='1' text='".xl ('0 None')."'>".
							xl ('0 None').
					"	</option>".
					"	<option value='2' text='".xl ('1+ Mid')."'>".
							xl ('1+ Mid') .
					"	</option>".
					"	<option value='3' text='".xl ('2+ Moderate')."'>".
							xl ('2+ Moderate') .
					"	</option>".
					"	<option value='4' text='".xl ('3 + Severe')."'>".
							xl('3+ Severe') .
					"	</option>".
					"</select></td>";
			$slit7 = "<td><select type='text' id='1_slitlamp_7' name='1_slitlamp_7'>".
					"	<option value='1' text='".xl ('0 None')."'>".
							xl ('0 None').
					"	</option>".
					"	<option value='2' text='".xl ('1+ Mid')."'>".
							xl ('1+ Mid') .
					"	</option>".
					"	<option value='3' text='".xl ('2+ Moderate')."'>".
							xl ('2+ Moderate') .
					"	</option>".
					"	<option value='4' text='".xl ('3 + Severe')."'>".
							xl('3+ Severe') .
					"	</option>".
					"</select></td>";
			$slit8 = "<td><select type='text' id='1_slitlamp_8' name='1_slitlamp_8'>".
					"	<option value='1' text='".xl ('0 None')."'>".
							xl ('0 None').
					"	</option>".
					"	<option value='2' text='".xl ('1+ Mid')."'>".
							xl ('1+ Mid') .
					"	</option>".
					"	<option value='3' text='".xl ('2+ Moderate')."'>".
							xl ('2+ Moderate') .
					"	</option>".
					"	<option value='4' text='".xl ('3 + Severe')."'>".
							xl('3+ Severe') .
					"	</option>".
					"</select></td>";
			$slit9 = "<td><select type='text' id='1_slitlamp_9' name='1_slitlamp_9'>".
					"	<option value='1' text='".xl ('0 None')."'>".
							xl ('0 None').
					"	</option>".
					"	<option value='2' text='".xl ('1+ Mid')."'>".
							xl ('1+ Mid') .
					"	</option>".
					"	<option value='3' text='".xl ('2+ Moderate')."'>".
							xl ('2+ Moderate') .
					"	</option>".
					"	<option value='4' text='".xl ('3 + Severe')."'>".
							xl('3+ Severe') .
					"	</option>".
					"</select></td>";
			$number = 2;
			while($row = sqlFetchArray($forms_info)){
				$slit1 .= "<td><select type='text' id='".$number."_slitlamp_1' name='".$number."_slitlamp_1'>".
						"	<option value='1' text='".xl ('0 None')."' ".selected(1, $row['']).">".
								xl ('0 None').
						"	</option>".
						"	<option value='2' text='".xl ('1+ Mid')."' ".selected(2, $row['']).">".
								xl ('1+ Mid') .
						"	</option>".
						"	<option value='3' text='".xl ('2+ Moderate')."' ".selected(3, $row['']).">".
								xl ('2+ Moderate') .
						"	</option>".
						"	<option value='4' text='".xl ('3 + Severe')."' ".selected(4, $row['']).">".
								xl('3+ Severe') .
						"	</option>".
						"</select></td>";
				$slit2 .= "<td><select type='text' id='".$number."_slitlamp_2' name='".$number."_slitlamp_2'>".
						"	<option value='1' text='".xl ('0 None')."' ".selected(1, $row['']).">".
								xl ('0 None').
						"	</option>".
						"	<option value='2' text='".xl ('1+ Mid')."' ".selected(2, $row['']).">".
								xl ('1+ Mid') .
						"	</option>".
						"	<option value='3' text='".xl ('2+ Moderate')."' ".selected(3, $row['']).">".
								xl ('2+ Moderate') .
						"	</option>".
						"	<option value='4' text='".xl ('3 + Severe')."' ".selected(4, $row['']).">".
								xl('3+ Severe') .
						"	</option>".
						"</select></td>";
				
				$slit3 .= "	<td><select type='text' id='".$number."_slitlamp_3' name='".$number."_slitlamp_3'>".
						"	<option value='1' text='".xl('0<1 cell')."' ".selected(1, $row['']).">".
								xl('0<1 cell') .						
						"	</option>".
						"	<option value='2' text='".xl('0.5+ 1-5 cells')."' ".selected(2, $row['']).">".
								xl('0.5+ 1-5 cells') .						
						"	</option>".
						"	<option value='3' text='".xl('1+ 6-15 cells')."' ".selected(3, $row['']).">".
								xl('1+ 6-15 cells') .						
						"	</option>".
						"	<option value='4' text='".xl('2+ 16-25 cells')."' ".selected(4, $row['']).">".
								xl('2+ 16-25 cells') .						
						"	</option>".
						"	<option value='5' text='".xl('3+ 26-50 cells')."' ".selected(5, $row['']).">".
								xl('3+ 26-50 cells') .						
						"	</option>".
						"	<option value='6' text='".xl('4+ >50 cells')."' ".selected(6, $row['']).">".
								xl('4+ >50 cells') .						
						"	</option>				".		
						"</select></td>";
				$slit4 .="<td><select type='text' id='".$number."_slitlamp_4' name='".$number."_slitlamp_4'>".
						"		<option value='1' text='".xl('0 None')."' ".selected(1, $row['']).">".
									xl('0 None') .							
						"		</option>".
						"		<option value='2' text='".xl('1+ Debil')."' ".selected(2, $row['']).">".
									xl('1+ Debil') .							
						"		</option>".
						"		<option value='3' text='".xl('2+ Moderate (Iris and lens details clear)')."' ".selected(3, $row['']).">".
									xl('2+ Moderate (Iris and lens details clear)') .							
						"		</option>".
						"		<option value='4' text='".xl('3+ Marked (Iris and lens details hazy)')."' ".selected(4, $row['']).">".
									xl('3+ Marked (Iris and lens details hazy)') .							
						"		</option>".
						"		<option value='5' text='".xl('4+ Itense (Fibrin or plastic aqueous)')."' ".selected(5, $row['']).">".
									xl('4+ Itense (Fibrin or plastic aqueous)') .							
						"		</option>".
						"</select></td>";
				$slit5 .= "<td><select type='text' id='".$number."_slitlamp_5' name='".$number."_slitlamp_5'>".
						"	<option value='1' text='".xl ('0 None')."' ".selected(1, $row['iris_atrophy_erosion']).">".
								xl ('0 None').
						"	</option>".
						"	<option value='2' text='".xl ('1+ Mid')."' ".selected(2, $row['iris_atrophy_erosion']).">".
								xl ('1+ Mid') .
						"	</option>".
						"	<option value='3' text='".xl ('2+ Moderate')."' ".selected(3, $row['iris_atrophy_erosion']).">".
								xl ('2+ Moderate') .
						"	</option>".
						"	<option value='4' text='".xl ('3 + Severe')."' ".selected(4, $row['iris_atrophy_erosion']).">".
								xl('3+ Severe') .
						"	</option>".
						"</select></td>";
				$slit6 .= "<td><select type='text' id='".$number."_slitlamp_6' name='".$number."_slitlamp_6'>".
						"	<option value='1' text='".xl ('0 None')."' ".selected(1, $row['iris_peaking']).">".
								xl ('0 None').
						"	</option>".
						"	<option value='2' text='".xl ('1+ Mid')."' ".selected(2, $row['iris_peaking']).">".
								xl ('1+ Mid') .
						"	</option>".
						"	<option value='3' text='".xl ('2+ Moderate')."' ".selected(3, $row['iris_peaking']).">".
								xl ('2+ Moderate') .
						"	</option>".
						"	<option value='4' text='".xl ('3 + Severe')."' ".selected(4, $row['iris_peaking']).">".
								xl('3+ Severe') .
						"	</option>".
						"</select></td>";
				$slit7 .= "<td><select type='text' id='".$number."_slitlamp_7' name='".$number."_slitlamp_7'>".
						"	<option value='1' text='".xl ('0 None')."' ".selected(1, $row['iris_rubeosis']).">".
								xl ('0 None').
						"	</option>".
						"	<option value='2' text='".xl ('1+ Mid')."' ".selected(2, $row['iris_rubeosis']).">".
								xl ('1+ Mid') .
						"	</option>".
						"	<option value='3' text='".xl ('2+ Moderate')."' ".selected(3, $row['iris_rubeosis']).">".
								xl ('2+ Moderate') .
						"	</option>".
						"	<option value='4' text='".xl ('3 + Severe')."' ".selected(4, $row['iris_rubeosis']).">".
								xl('3+ Severe') .
						"	</option>".
						"</select></td>";
				$slit8 .= "<td><select type='text' id='".$number."_slitlamp_8' name='".$number."_slitlamp_8'>".
						"	<option value='1' text='".xl ('0 None')."' ".selected(1, $row['lens_opacity']).">".
								xl ('0 None').
						"	</option>".
						"	<option value='2' text='".xl ('1+ Mid')."' ".selected(2, $row['lens_opacity']).">".
								xl ('1+ Mid') .
						"	</option>".
						"	<option value='3' text='".xl ('2+ Moderate')."' ".selected(3, $row['lens_opacity']).">".
								xl ('2+ Moderate') .
						"	</option>".
						"	<option value='4' text='".xl ('3 + Severe')."' ".selected(4, $row['lens_opacity']).">".
								xl('3+ Severe') .
						"	</option>".
						"</select></td>";
				$slit9 .= "<td><select type='text' id='".$number."_slitlamp_9' name='".$number."_slitlamp_9'>".
						"	<option value='1' text='".xl ('0 None')."' ".selected(1, $row['slit_lamp_other']).">".
								xl ('0 None').
						"	</option>".
						"	<option value='2' text='".xl ('1+ Mid')."' ".selected(2, $row['slit_lamp_other']).">".
								xl ('1+ Mid') .
						"	</option>".
						"	<option value='3' text='".xl ('2+ Moderate')."' ".selected(3, $row['slit_lamp_other']).">".
								xl ('2+ Moderate') .
						"	</option>".
						"	<option value='4' text='".xl ('3 + Severe')."' ".selected(4, $row['slit_lamp_other']).">".
								xl('3+ Severe') .
						"	</option>".
						"</select></td>";
				$number += 1;
			}
		}
		
		create_slit(0);
?>
        <table class="vertical_table" id='t_external_ocular_exam'>
            <caption><?php echo xl('Slit Lamp Examination (For each question, mark one box per eye)');?></caption>
            <thead>
                <tr>
                    <th colspan="3"><?php echo xl('Cornea - Edema'); ?></th>
                </tr>
				<tr>
                    <th colspan="3"><?php echo xl('Cornea - Staining/Erosion'); ?></th>
                </tr>
				<tr>
                    <th colspan="3"><?php echo xl('Anterior Chamber Cells'); ?></th>
                </tr>
				<tr>
                    <th colspan="3"><?php echo xl('Anterior Chamber Flare'); ?></th>
                </tr>
				<tr>
                    <th colspan="3"><?php echo xl('Iris Athrophy/Erosion'); ?></th>
                </tr>
				<tr>
                    <th colspan="3"><?php echo xl('Iris Peaking'); ?></th>
                </tr>
				<tr>
                    <th colspan="3"><?php echo xl('Iris Rubeosis'); ?></th>
                </tr>
				<tr>
                    <th colspan="3"><?php echo xl('Lens Opacity'); ?></th>
                </tr>
				<tr>
                    <th colspan="3"><?php echo xl('Slit Lamp Other'); ?></th>
                </tr>
            </thead>
            <tbody>
				<tr>
					<?php echo $slit1;?>
				</tr>
				<tr>
					<?php echo $slit2;?>
				</tr>
				<tr>
					<?php echo $slit3;?>
				</tr>
				<tr>
					<?php echo $slit4;?>
				</tr>
				<tr>
					<?php echo $slit5;?>
				</tr>
				<tr>
					<?php echo $slit6;?>
				</tr>
				<tr>
					<?php echo $slit7;?>
				</tr>
				<tr>
					<?php echo $slit8;?>
				</tr>
				<tr>
					<?php echo $slit9;?>
				</tr>
				
            </tbody>
           
            </tfoot>
        </table>